#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2020/11/2 10:31
# @Author  : Andrewq
# @Site    : nope
# @File    : UserCollectModel.py
# @Software: PyCharm
import datetime

from flask import g, current_app
from sqlalchemy import or_

from . import db
from ..utils import commons
from ..utils.response_code import RET


class UserCollect(db.Model):
    __tablename__ = 'user_collect'

    collectID = db.Column(db.String(30, 'utf8_general_ci'), primary_key=True, info='收藏主键')
    parentID = db.Column(db.String(30, 'utf8_general_ci'), info='文件的父节点ID')
    userID = db.Column(db.String(30, 'utf8_general_ci'), nullable=False, info='用户ID')
    informationID = db.Column(db.ForeignKey('information_info.informationID', ondelete='CASCADE', onupdate='CASCADE'), index=True, info='资料ID')
    title = db.Column(db.String(255, 'utf8_general_ci'), nullable=False, info='收藏标题')
    text = db.Column(db.String, info='收藏内容')
    IsDeleted = db.Column(db.Integer, server_default=db.FetchedValue(), info='0 --没有删除  1--删除')
    type = db.Column(db.Integer, server_default=db.FetchedValue(), info='收藏类型：\\r\\n0-普通收藏\\r\\n1-笔记收藏 2-笔记文件夹 3-收藏文件夹')
    createTime = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='创建时间')